package com.cloudcross.ssp.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.cloudcross.ssp.base.service.IGenericService;
import com.cloudcross.ssp.common.utils.Pager;
import com.cloudcross.ssp.model.Order;

public interface IOrderService extends IGenericService<Order> {

    /**
     * 按条件查找订单
     * 
     * @param advertiserType
     * @return
     */
    List<Order> findByAdvertiserType(String advertiserType);

    //按advertiserId查找订单
    List<Order> findByAdvertiserId(Long advertiserId);

    //按订单名查找订单
    long findByName(String name);

    //按订单状态查找订单
    List<Order> findByStatus(Map<String, Object> paramMap);

    //导出Excel用
    List<Order> findDeliverEffectAnalysis(Map<String, Object> paramMap);

    //向t_adgroup里面插入Supdated
    boolean updateSupdated(List<Long> orderIdList, int status);

    String selectOrderNameById(Long id);

    boolean updateSupdatedAll(List<Long> orderIdList, Date date);

    boolean updateStatusByAdvertiserId(List<Long> AdvertiseIdList, int status);

    boolean updateStatusAll(List<Long> orderIdList, int status);

    int countByParamsBack(Map<String, Object> paramMap);

    int countByParamsOperator(Map<String, Object> paramMap);

    List<Order> findByParamsOperator(Map<String, Object> paramMap, Pager pager);

    List<Order> findByParamsBack(Map<String, Object> paramMap, Pager pager);

    boolean addBack(Order t);
    
    /**
     * 根据排期下线订单
     * 
     * @return
     */
    void offLineOrder();
}
